// {{ .Data.GenerateTitle }}
package filter

import (
	"gitee.com/kristas/booting-go/framework"
	"gitee.com/kristas/booting-go/framework/core/log"
	"gitee.com/kristas/booting-go/framework/core/statement/types"
	"gitee.com/kristas/booting-go/framework/web"
	"net/http"
)

func init() {
	framework.Component(new({{ .Data.ComponentName }}))
}

type {{ .Data.ComponentName }} struct {
	types.Filter `order:"{{ .Data.Order }}" pattern:"{{ .Data.Pattern }}"`
	Log          log.Logger `wire:""`
}

func (f *{{ .Data.ComponentName }}) DoFilter(w http.ResponseWriter, r *http.Request, chain web.FilterChain) error {
	//TODO input your pre filter logic
	err := chain.DoFilter(w, r)
	//TODO input your post filter logic
	return err
}
